#!/sbin/openrc-run

description="Netfilter userspace logging daemon"

extra_started_commands="reload"
description_reload="Reload configuration"

command="/usr/sbin/ulogd"
# $ulogd_opts is only for backward compatibility (Alpine <3.19)
command_args="$ulogd_opts $command_args"
command_background="yes"
command_user="root:wheel"
pidfile="/run/$RC_SVCNAME.pid"
umask=027

required_files="/etc/ulogd.conf"

depend() {
	before firewall
}

reload() {
	ebegin "Reloading $RC_SVCNAME"

	if [ "$supervisor" ]; then
		$supervisor "$RC_SVCNAME" --signal HUP
	else
		start-stop-daemon --pidfile "$pidfile" --signal HUP
	fi
	eend $?
}
